##
## LATIN AMERICAN POLITICS AND SOCIETY
## Title: Government and Opposition in Legislative Speechmaking: Using Text-As-Data to Estimate Brazilian Political Parties Policy Positions
## Authors: Mauricio Izumi and Danilo Medeiros
## Emails: mauricioizumi@hotmail.com; danilobuscatto@gmail.com
##

In this file you find the instructions to replicate the results presented in the paper.

1. The folder "main_results" contains all files used to estimate the main results of the paper (Figures 1, 2 and 3):
	- "script_figures.R": code to replicate Figures 1, 2 and 3;
	- "sentiment_irt.csv": dataset with policy positions (IRT model) (Figure 1). The results are calculated in folder "opinion_irt";
	- "policy_positions.csv": dataset with policy positions based surveys, manifestos and roll calls (Figures 2 and 3).

2. The folder "opinion_irt" contains all files used to run the main results of the paper (sentiment analysis, IRT estimates and accuracy evaluation):
	- "script_irt.R" code to run IRT model;
	- "binomial_model.bug": JAGS model;
	- "disc_95-14.csv": dataset with all speeches;
	- "training_set.rds": dataset with speeches used to train the model (sentiment analysis);
	- "accuracy.rds": dataset with speeches used to cross validade the results (sentiment analysis);
	
- Codebook for dataset "disc_95-14.csv":
	- link: website url for the speech;
	- senador: senator's name;
	- partido: senator's political party;
	- uf: senator's state;
	- data: speeches' date;
	- resumo: speeches' abstract;
	- index: speeches' key-words;
	- catalogo: speeches' topics;
	- ano: speeches' year.